﻿using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Idte.Application.Core.Navigation
{
    public class MenuItem 
    {
        public MenuItem()
        {
            Items = new HashSet<MenuItem>();
        }

        [Key, DatabaseGenerated(DatabaseGeneratedOption.Identity)]
        public int ItemId { get; set; }
        public string Title { get; set; }

        [ForeignKey("SubMenuId")]
        public Menu SubMenu { get; set; }
        public string SubMenuId { get; set; }

        [ForeignKey("ParentName")]
        public Menu ParentMenu { get; set; }
        public string ParentName { get; set; }


        [ForeignKey("ParentItemId")]
        public MenuItem ParentItem { get; set; }
        public int? ParentItemId { get; set; }

        [InverseProperty("ParentItem")]
        public virtual ICollection<MenuItem> Items { get; set; }

        public string Action { get; set; }
        public string Area { get; set; }
        public string Controller { get; set; }
    }
}
